package cn.ssm_05.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import cn.ssm_05.dao.UserDao;
import cn.ssm_05.dao.UserDaoImpl;
import cn.ssm_05.entity.User;
import cn.ssm_05.factory.MyBeanFactory;

//userService
@Service//("userService") //bean id userServiceImpl
public class UserServiceImpl implements UserService {

	@Autowired //默认按照类型 spring
//	@Resource //java
	UserDao userDao;// = (UserDao)MyBeanFactory.getBean("userDao");

	public List<User> selectUser() {
		System.out.println("查询用户");
		return userDao.selectUser();
	}

	@Override
	public void addUser(User user) {
		
//			int age = 10 / 0;
	
		System.out.println("添加用户");
	}
}
